﻿using Framework;

namespace View
{
    public class HotRecipeView : ViewProxy
    {
        private ClickTrigger _triggerRecipe;
        private ClickTrigger _triggerOrder;
        private ClickTrigger _triggerInfo;
		
        protected override void SetupView()
        {
            LoadRes("Views/Recipe/HotRecipeView");
        }

        protected override void OnInit()
        {
            _triggerRecipe = ClickTrigger.Get(_transform.Find("Button_Recipe"));
            _triggerRecipe.AddClickListener(OnRecipeClick);
            _triggerOrder = ClickTrigger.Get(_transform.Find("Button_Order"));
            _triggerOrder.AddClickListener(OnOrderClick);
            _triggerInfo = ClickTrigger.Get(_transform.Find("Button_Info"));
            _triggerInfo.AddClickListener(OnInfoClick);
        }
        
        private void OnRecipeClick(params object[] args)
        {
            new MyRecipeView().Show();
            Close();
        }
        
        private void OnOrderClick(params object[] args)
        {
            new OrderView().Show();
            Close();
        }
        
        private void OnInfoClick(params object[] args)
        {
            new AccountView().Show();
            Close();
        }
    }
}